﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="gen.aspx.cs" Inherits="HRM.Web.gen" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div id="divDebug" runat="server">
    <table style="width:100%"><tr>
       <td>Ascx List:&nbsp;
           <asp:DropDownList ID="cboAscxList" runat="server" Width="300px">
           </asp:DropDownList>
           &nbsp; <asp:LinkButton ID="btnLoadAscx" runat="server" OnClientClick="javascript:return setAscxPath();">Load 
           Ascx</asp:LinkButton>
       &nbsp;&nbsp;
           |&nbsp;
           <asp:LinkButton ID="btnGenCode" runat="server" OnClientClick="javascript:return setGenCodePath();" >Gen Code</asp:LinkButton>
       </td>
        <td>User Name:
           <asp:TextBox ID="txtUser_Name" runat="server" ValidationGroup="Login"></asp:TextBox>
           <asp:Button ID="btnLogin" runat="server" onclick="btnLogin_Click" 
           Text="Login" ValidationGroup="Login" />
                <asp:LoginName ID="LoginName1" runat="server" />
        </td>
   </tr></table> 
    <hr />
    </div>
    <div style="padding:1px 10px"><asp:PlaceHolder ID="plhAscx" runat="server"></asp:PlaceHolder></div>
    <asp:CustomValidator ID="cvalError" runat="server" ErrorMessage="CustomValidator"></asp:CustomValidator>
    </form>
    <script type="text/javascript">
    function setAscxPath(){
        var cboAscxList=document.getElementById("cboAscxList");  
        hdfAscxPath=document.getElementById("hdfAscxPath");
        hdfAscxPath.value=cboAscxList.value; 
        var sLocation=new String(document.location);
        var i = sLocation.indexOf("?");
        //alert(i);
        if (i==-1)    
            document.location=document.location+"?index="+cboAscxList.selectedIndex;
        else    
            document.location=sLocation.substring(0,i) +"?index="+cboAscxList.selectedIndex;
        return false;
    }
    function setGenCodePath(){
        //alert('ok');
        hdfAscxPath=document.getElementById("hdfAscxPath");
        hdfAscxPath.value="~/ClassGenerate.ascx";  
        //alert(hdfAscxPath.value); 
        var sLocation=new String(document.location);  
        var i = sLocation.indexOf("?");
        //alert(i);
        if (i!=-1)        
            document.location=sLocation.substring(0,i);
        return false;
    </script>
</body>
</html>
